#!/usr/bin/python
# -*- coding: utf-8 -*-
import utlis


class Mingju(object):
    def __init__(self, data):
        self.id = data['id']
        self.idnew = utlis.toString(data['idnew'])
        self.nameStr = utlis.toString(data['nameStr'])
        self.classStr = utlis.toString(data['classStr'])
        self.type = utlis.toString(data['type'])
        self.shiID = data['shiID']
        self.shiIDnew = utlis.toString(data['shiIDnew'])
        self.exing = data['exing']
        self.author = utlis.toString(data['author'])
        self.shiName = utlis.toString(data['shiName'])
        self.ipStr = utlis.toString(data['ipStr'])
        self.isShiwen = data['isShiwen']
        self.gujiyiwen = utlis.toString(data['gujiyiwen'])
        self.zhangjieID = utlis.toString(data['zhangjieID'])
        self.zhangjieNameStr = utlis.toString(data['zhangjieNameStr'])
        self.themeStr = ''
        self.classifyStr = ''

    def obj_2_json(self):
        return {
            'id': self.id,
            'idnew': self.idnew,
            'shiID': self.shiID,
            'author': self.author
        }